import request from '@/utils/request'

export function getDepartments() {
  // 配置 url,method,参数 data , params
  return request({
    url: '/company/department'
  })
}

export function aboutDepartments(id) {
  // 配置url
  return request({
    url: `/company/department/${id}`
  })
}

export function updateDepartments(data) {
  // 配置url , method , 参数data
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}

export function addDepartment(data) {
  // 配置url , method , 参数data
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

/**
 * @description: 删除部门
 * @param {*} id 当前点击的操作按钮 所在的项的id
 * @return {*}
 */
export function delDepartment(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}

